<template>
  <Wrap>
    <view>
      <img src="" alt="" />
    </view>
    <h1>{{ state.msg }}</h1>
    <div class="btn">
      <nut-button type="primary" @click="handleClick('text', state.msg2, true)">点我</nut-button>
    </div>
    <nut-toast :msg="state.msg" v-model:visible="state.show" :type="state.type" :cover="state.cover" />
  </Wrap>
</template>

<script setup lang="ts">
  import { reactive } from 'vue';

  const state = reactive({
    msg: '欢迎使用 NutUI3.0 开发小程序',
    msg2: '你成功了～',
    type: 'text',
    show: false,
    cover: false
  });
  console.log(process.env.BASE_URL);
  const handleClick = (type, msg, cover = false) => {
    state.show = true;
    state.msg2 = msg;
    state.type = type;
    state.cover = cover;
  };
</script>
